package org.andcool.animation.ease;

/**
 * @author Joosun
 * @since 2011-5-8
 */
public class EaseQuart extends BaseEase
{
	public EaseQuart(final EasingMode pEasingMode)
	{
		super(pEasingMode);
	}

	@Override
	protected float getEaseInInterpolation(final float pPercentage)
	{
		return pPercentage * pPercentage * pPercentage * pPercentage;
	}

	@Override
	protected float getEaseOutInterpolation(float pPercentage)
	{
		return -((pPercentage -= 1) * pPercentage * pPercentage * pPercentage - 1);
	}

	@Override
	protected float getEaseInOutInterpolation(float pPercentage)
	{
		pPercentage *= 2;

		if (pPercentage < 1)
		{
			return 0.5f * pPercentage * pPercentage * pPercentage * pPercentage;
		}
		else
		{
			return -0.5f * ((pPercentage -= 2) * pPercentage * pPercentage * pPercentage - 2);
		}
	}
}